package com.aos.erp.schools.service.coach.impl;



import com.aos.erp.common.bean.IPageBean;
import com.aos.erp.common.bean.PageBean;
import com.aos.erp.common.dao.mapper.Condition;
import com.aos.erp.common.exception.BizException;
import com.aos.erp.schools.mapper.coach.CoachPictureMapper;
import com.aos.erp.schools.model.coach.CoachPicture;
import com.aos.erp.schools.service.coach.CoachPictureService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service
public class CoachPictureServiceImpl extends ServiceImpl<CoachPictureMapper,CoachPicture> implements CoachPictureService {

    @Resource
    private CoachPictureMapper coachPictureMapper;

    @Override
    public CoachPicture getById(long id) {
        return baseMapper.selectById(id);
    }

    @Override
    public void addBean(CoachPicture bean) throws BizException {
        baseMapper.insert(bean);
    }

    @Override
    public PageBean<CoachPicture> queryByPage(long pageIndex, long pageSize) {

        IPageBean<CoachPicture> pageBean = baseMapper.createBizPage(pageIndex, pageSize);
        Condition condition = new Condition(CoachPicture.class);
        condition.orderByDesc("id");

        return (PageBean<CoachPicture>) baseMapper.selectPage(pageBean, condition.getWrapper());
    }
    @Override
    public List<CoachPicture> queryList(Map<String, Object> map) {
        return coachPictureMapper.queryList(map) ;
    }

	@Override
	public int updatePic(CoachPicture coachPicture) {
		return coachPictureMapper.updatePic(coachPicture) ;
	}
}